<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Date</title>
    <style>
        #box{
            width: 400px;
            height: 300px;
            background: #369;
            margin: 100px auto;
            text-align: center;
            color: #fff;
        }
        #box p{
            line-height: 80px;
            font-size: 20px;
        }
        #box div{
            width: 150px;
            height: 150px;
            margin:0 75px;
            background: orange;
            font-size: 80px;
            line-height: 150px;
            color: #000;
        }
    </style>
    <script>
        window.onload = function(){
            var box = document.getElementById("box");
            var p1 = box.children[0];
            var div = box.children[1];
            var date = new Date();
            var days = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]
            p1.innerHTML = date.getFullYear() + "年" + (date.getMonth()+1) + "月" + date.getDate() + "日" + date.getHours()+"时"+date.getMinutes()+"分"+date.getSeconds()+"秒 " + days[date.getDay()]
            // div.innerHTML = date.getDate();
            setInterval(function(){
                var date = new Date();
                div.innerHTML = date.getSeconds();
            },1000)


        } 
    </script>
</head>
<body>
    <div class="box" id="box">
        <p><!-- 2016年11月30日 星期三 --></p>
        <div></div>
    </div>
</body>
</html>